<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8" />
	<script type="text/javascript" src="../lib/vue.js"></script>
    <!--如果vue想做交互 引入: vue-resouce.js-->
	<script type="text/javascript" src="../lib/vue-resource.js"></script>
	<script type="text/javascript">
		window.onload=function(){
			var vm = new Vue({
				el: "#box",
				data:{
					//数据

				},
                methods:{
                    gethaosou:function(){
                        //https://sug.so.360.cn/suggest?callback=suggest_so&encodein=utf-8&encodeout=utf-8&format=json&fields=word,obdata&word=&fields=word,obdata&word=%20
                        //做处理  https://sug.so.360.cn/suggest?callback=suggest_so&word=a
                        this.$http.jsonp("https://sug.so.360.cn/suggest",{
                            word:'a',
                            encodein:'utf-8',
                        }).then(function(res1){
                            console.log(res1);
                        },function(res2){
                            console.log(res2);
                        })
                    },
                    getbaidu:function(){
                        //https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=a&json=1&p=3&sid=22583_1464_21112_17001_20881_22176_22160&req=2&csor=1&cb=jQuery11020797948577722277_1492306899197&_=1492306899200
                        //做处理  https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=a&cb=jshow
                        this.$http.jsonp("https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su",{
                            wd:'a'
                        },{
                            jsonp:'cb'	//callback名字，默认名字就是"callback"
                        }
                        ).then(function(res1){
                            console.log(res1);
                        },function(res2){
                            console.log(res2);
                        })
                    }
                }
			})
		}
	</script>
</head>
<body>
<div id="box">
    <input type="button" value="按钮360" @click="gethaosou()"> <br /><br />
    <input type="button" value="按钮百度" @click="getbaidu()">
</div>
</body>
</html>